import Vue from 'vue'
import App from './App.vue'

import Vant from 'vant';
import 'vant/lib/index.css';
import router from './router';
// 引入icon图标
import { Icon } from 'vant';

import { Tabbar,TabbarItem } from 'vant';
import { Tab,Tabs } from 'vant';

import { NavBar } from 'vant';
import { PullRefresh } from 'vant';
import { List } from 'vant';  //引入List组件 用于上拉加载,下拉刷新
import { Toast } from 'vant';  //引入Toast提示
import { Form } from 'vant';  //引入Form表单


Vue.use(Vant)
Vue.use(Tabbar);
Vue.use(TabbarItem);
Vue.use(Icon);
Vue.use(Tab);
Vue.use(Tabs);
Vue.use(NavBar);
Vue.use(List);

Vue.use(PullRefresh);
Vue.use(Toast);
Vue.use(Form);



// Vue指令loading 全局配置
Vue.directive('loading',{
  inserted(el,binding){
    binding.value?el.classList.add('loading'):el.classList.remove('loading')
  },
  update(el,binding){
    binding.value?el.classList.add('loading'):el.classList.remove('loading')
  }
  
})


Vue.config.productionTip = false

new Vue({
  render: h => h(App),
  router
}).$mount('#app')
